import {dateFormat} from "/utils/commonMethod"
Component({
  mixins: [],
  data: {
    clockRecordList: []
  },
  props: {
    list: []
  },
  didMount() {
  },
  didUpdate() {
    // console.log(this.props,"list")
    //处理日期格式显示
    this.props.list.forEach(element => {
      element.startDate = dateFormat(element.startDate);
      element.endDate = dateFormat(element.endDate);
    });
    this.setData({
      clockRecordList: this.props.list
    })
   },
  didUnmount() { },
  methods: {
    goDetail(e) {
      dd.navigateTo({
        url: `/pages/visitClock/merchantRecordDetail/merchantRecordDetail?id=${e.currentTarget.dataset.id}`
      })
    }
  },
});
